home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SNNSV32.ZIP / SNNSv3.2 / kernel / sources / kr_rand.c < prev    next >
C/C++ Source or Header  |  1994-04-25  |  886b  |  44 lines

  1. /*****************************************************************************
  2.   FILE           : kr_rand.c
  3.   SHORTNAME      : 
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : SNNS Kernel randomize functions for MS-DOS
  7.   NOTES          :
  8.  
  9.   AUTHOR         : Niels Mache
  10.   DATE           : 30.06.92
  11.  
  12.   CHANGED BY     : Sven Doering
  13.   IDENTIFICATION : @(#)kr_rand.c    1.8 3/15/94
  14.   SCCS VERSION   : 1.8
  15.   LAST CHANGE    : 3/15/94
  16.  
  17.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  18.  
  19. ******************************************************************************/
  20. #ifdef  __MSDOS__
  21.  
  22. #ifndef  MSDOS_RAND_FUNCS
  23. #define  MSDOS_RAND_FUNCS
  24.  
  25. #include <stdlib.h>
  26.  
  27. void srand48(long seedval)
  28. {
  29.         srand((int) seedval);
  30. }
  31.  
  32. long lrand48(void )
  33. {
  34.         return ((long) rand());
  35. }
  36.  
  37. double drand48(void)
  38. {
  39.         return ((double) rand() / (double) RAND_MAX);
  40. }
  41.  
  42. #endif
  43. #endif
  44.